#include "DummyBullet.h"

using namespace mega;


DummyBullet::DummyBullet(const Position & _position, const float & _size)
	: m_shape(_size)
	, m_velocity(1.f, 1.f)
{
	m_shape.setFillColor(sf::Color(255, 150, 100));
	m_shape.setOrigin(m_shape.getRadius() / 2, m_shape.getRadius() / 2);
	m_shape.setPosition(_position);
}


DummyBullet::DummyBullet(DummyBullet && _rhs)
	: m_shape(std::move(_rhs.m_shape))
	, m_velocity(std::move(_rhs.m_velocity))
{}


DummyBullet::~DummyBullet()
{}


void DummyBullet::render(RenderTarget & _target)
{
	_target.draw(m_shape);
}


void DummyBullet::move(const Position & _offset)
{
	GameObject::move(_offset);

	m_shape.move(_offset);
}


void DummyBullet::updateState()
{
	this->move(m_velocity);
}


void DummyBullet::setVelocity(float x, float y)
{
	m_velocity.x = x;
	m_velocity.y = y;
}
